import java.util.Calendar;

/**
 * Content: Arrays类常用方法、数组转列表、复制数组
 * --------------------------------------------------
 * Java中获取日期和时间: https://blog.csdn.net/weixin_51253044/article/details/127018484
 */

public class Java_1012_class_Calendar {
    public static void main(String[] args) {

        // Calendar类常用方法
        System.out.println("--------------------Calendar类常用方法--------------------");

        Calendar c = Calendar.getInstance();

        System.out.println(c.get(Calendar.YEAR) + "年");              //年
        System.out.printf("%02d月%n",c.get(Calendar.MONTH)+1);        //月
        System.out.println(c.get(Calendar.DATE) + "日");             //日
        System.out.println(c.get(Calendar.HOUR_OF_DAY) + "时");      //时
        System.out.println(c.get(Calendar.MINUTE) + "分");           //分
        System.out.println(c.get(Calendar.SECOND) + "秒");           //秒
        System.out.println(c.get(Calendar.MILLISECOND) + "毫秒");    //毫秒

    }
}
